<!DOCTYPE html>
<html lang="en">

<head>
    <title></title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="css/style.css" rel="stylesheet">
    <style>
        * {
            padding: 0;
            margin: 0;
        }

        div {
            border-bottom-left-radius: 25px;
            border-top-left-radius: 25px;
            border-top-right-radius: 25px;
            border-bottom-right-radius: 25px;
        }

        .progress {
            width: 100vw;
            height: 50px;
            background-image: linear-gradient(90deg, pink, red)
        }

        .progress div {
            /* width: 50%; */
            height: 100%;
            background-image: linear-gradient(90deg, green, blue);
            text-align: center;
            line-height: 50px;
        }
    </style>
</head>


<body>
    <div class="progress">
        <div class="Ptop"></div>
    </div>
</body>
<script>
    const progress = document.querySelector('.Ptop');
    for (let i = 1; i < 100; i++) {
        progress.style.width = (i / 100) * 100;
    }
    let num = 1;
    let id = setInterval(() => {
        num++;
        let pro = (num / 100) * 100;
        progress.style.width = pro + '%';
        progress.innerHTML = num + "%";
        if (pro >= 100) clearInterval(id);
        // console.log(num);
    }, 1000);
</script>

</html>